package test.mooc;

public class Car {
    String name;
    private Engine  getEngine(){
        return new Engine();
    }
    // 汽车的跑动方法
    public void run(String name) {
        System.out.println(name + "跑起来了！");
    }
    private class Engine{
        private String name = "引擎";
        private void run(){
            System.out.println("Engine中的成员属性name=" + name);
            System.out.println(Car.this.name + "的发动机启动了！");
            Car.this.run(Car.this.name);
        }
    }

    public static void main(String[] args) {
        Car car = new Car();
        car.name = "大奔奔";
        Engine engine = car.getEngine();
        engine.run();
    }
}
